package multiThreading.waitNotify;

public class Main {
public static void main(String[] args) {
	Message msg = new Message();
	System.out.println(msg.getMsg());
	Thread producer = new Thread(new Waiter(msg));
	producer.setName("first");
	
	Thread consumer = new Thread(new Notifier(msg));
	consumer.setName("second");
	producer.start();
	consumer.start();
	
	
	/*
	 * waiting to end !
	 */
	try {
		producer.join();
		consumer.join();
	} catch (InterruptedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
}
}
